<!DOCTYPE html>
<html>

<head>
    <style>
        ul {
            list-style-type: none;
            margin: 0;
            padding: 0;
            width: 200px;
            background-color: #f1f1f1;
        }
        
        li a {
            display: block;
            color: #000;
            padding: 8px 16px;
            text-decoration: none;
        }
        
        li a.active {
            background-color: #4CAF50;
            color: white;
        }
        
        li a:hover:not(.active) {
            background-color: #555;
            color: white;
        }
    </style>
</head>

<body>

    <h2>垂直导航栏</h2>
    <p>In this example, we create an "active" class with a green background color and a white text. The class is added to the "Home" link.</p>

    <ul>
        <li><a class="active" href="#home">首页</a></li>
        <li><a href="#news">新闻</a></li>
        <li><a href="#contact">联系我们</a></li>
        <li><a href="#about">关于我们</a></li>
    </ul>

</body>

</html>